home *** CD-ROM | disk | FTP | other *** search
- Path: prairienet.org!wemccaug
- From: wemccaug@prairienet.org (Wendy E. McCaughrin)
- Newsgroups: comp.lang.c++
- Subject: Re: what does this code do?
- Date: 14 Apr 1996 01:15:09 GMT
- Organization: University of Illinois at Urbana
- Message-ID: <4kpjit$74s@vixen.cso.uiuc.edu>
- References: <3167217D.AC7@lex.infi.net> <4k6u2v$i2c@newsbf02.news.aol.com>
- Reply-To: wemccaug@prairienet.org (Wendy E. McCaughrin)
- NNTP-Posting-Host: firefly.prairienet.org
-
-
- In a previous article, hightowr@lex.infi.net (Scott Hightower) says:
-
- >Mrdavc wrote:
- >>
- >> linePtrs[currentLine][lineLen[currentLine]] = (char) key;
- >>
- >> What does this code do? It looks like linePtrs is a multidimensional
- >> array but its not defined that way. is both linePtrs[currentLine] and
- >> lineLen[currentLine] set to (char) key??
- >>
- >> example from Teach yourself Turbo C++ 4.5 for Windows by Craig Arnush
- >> p,355
- >
- Why not just do what the compiler does and parse the expression?
- 'currentLine' must be some positive integer to be used as a sub-
- script and 'lineLen' is an array of positive integers (I suppose,
- line lengths) to be used as the second subscript to 'linePtrs'.
- Then 'linePtrs' is a 2-dimensional array of chars, apparently
- (since it is assigned a char). Interpretation: each line of the
- 2-D array may be a character-string (so 'linePtrs' is like argv)
- and since origins begin at 0, lineLen[currentLine] is the index
- of the null-terminator, where (char)key goes in the current line.
-
-